/*
 * @lc app=leetcode.cn id=7 lang=javascript
 *
 * [7] 整数反转
 */

// @lc code=start
/**
 * @param {number} x
 * @return {number}
 */
var reverse = function (x) {
    var a, b, c;
    a = x % 10
    b = (x % 100 - x % 10) / 10
    c = (x - x % 100) / 100
    if (c == 0) {
        if (b == 0) {
            return a
        }
        return a * 10 + b
    }
    return (a * 100 + b * 10 + c)
};
// @lc code=end

